package happywing.client.widget;



import happywing.client.Stage;
import happywing.client.widget.icon.Icon;
import happywing.client.widget.icon.IconState;

import com.gargoylesoftware.htmlunit.protocol.about.Handler;
import com.google.gwt.dev.ui.UiEvent.Type;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;

public class Home extends Composite {
	private FlowPanel home=new FlowPanel();
	
	public Home(){
		Icon icon1=new Icon("desk-png1.png","Flash播放室",
				"新增3个flash学习影片：java测试，数据库之伤",IconState.create("icon-state1.png"));
		
		Icon icon2=new Icon("desk-png2.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		Icon icon3=new Icon("desk-png3.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤",IconState.create("icon-state1.png"));
		
		Icon icon4=new Icon("desk-png4.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤",IconState.create("icon-state2.png"));
		
		Icon icon5=new Icon("desk-png5.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		Icon icon6=new Icon("desk-png6.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		Icon icon7=new Icon("desk-png7.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤",IconState.create("icon-state3.png"));
		
		Icon icon8=new Icon("desk-png8.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		Icon icon9=new Icon("desk-png9.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		Icon icon10=new Icon("desk-png10.png","Flash播放室",
		"新增3个flash学习影片：java测试，数据库之伤");
		
		home.add(icon1);
		home.add(icon2);
		home.add(icon3);
		home.add(icon4);
		home.add(icon5);
		home.add(icon6);
		home.add(icon7);
		home.add(icon8);
		home.add(icon9);
		home.add(icon10);
		
		ClickHandler handler=new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Stage.get().getLocation().go(new Home());
			}
		};
		ClickHandler handler2=new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Stage.get().getLocation().next(new Home());
			}
		};
		ClickHandler handler3=new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Stage.get().getLocation().next(new Contacts());
			}
		};
		
		icon1.addDomHandler(handler,ClickEvent.getType());
		icon2.addDomHandler(handler2,ClickEvent.getType());
		icon3.addDomHandler(handler3,ClickEvent.getType());

	    initWidget(home);
	    setStyleName("uiitem-container");
	}
}
